#ifndef ODBCWRAPPER_H_
#define ODBCWRAPPER_H_

#ifdef _WINDOWS
#include <windows.h>
#endif

#include <sqlucode.h>
#include <boost/thread/mutex.hpp>

#include "DynLib.h"

// TYPEDEFs for function pointers - generated code
typedef SQLRETURN  SQL_API _fn_SQLAllocHandleType(SQLSMALLINT HandleType, SQLHANDLE InputHandle, __out SQLHANDLE *OutputHandle);

typedef SQLRETURN  SQL_API _fn_SQLBindColType(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, __inout_xcount_opt(BufferLength) SQLPOINTER TargetValue, SQLLEN BufferLength, __inout_opt SQLLEN *StrLen_or_Ind);

typedef SQLRETURN SQL_API _fn_SQLBindParameterType( SQLHSTMT           hstmt, SQLUSMALLINT       ipar, SQLSMALLINT        fParamType, SQLSMALLINT        fCType, SQLSMALLINT        fSqlType, SQLULEN            cbColDef, SQLSMALLINT        ibScale, SQLPOINTER         rgbValue, SQLLEN             cbValueMax, SQLLEN             *pcbValue);

typedef SQLRETURN SQL_API _fn_SQLBrowseConnectType( SQLHDBC            hdbc, __in_ecount(cchConnStrIn) SQLCHAR           *szConnStrIn, SQLSMALLINT        cchConnStrIn, __out_ecount_opt(cchConnStrOutMax) SQLCHAR           *szConnStrOut, SQLSMALLINT        cchConnStrOutMax, __out_opt SQLSMALLINT       *pcchConnStrOut);

typedef SQLRETURN SQL_API _fn_SQLBrowseConnectWType( SQLHDBC             hdbc, __in_ecount(cchConnStrIn) SQLWCHAR* szConnStrIn, SQLSMALLINT         cchConnStrIn, __out_ecount_opt(cchConnStrOutMax) SQLWCHAR* szConnStrOut, SQLSMALLINT         cchConnStrOutMax, __out_opt SQLSMALLINT*        pcchConnStrOut );

typedef SQLRETURN   SQL_API _fn_SQLBulkOperationsType( SQLHSTMT            StatementHandle, SQLSMALLINT         Operation);

typedef SQLRETURN  SQL_API _fn_SQLCancelType(SQLHSTMT StatementHandle);

typedef SQLRETURN  SQL_API _fn_SQLCloseCursorType(SQLHSTMT StatementHandle);

#ifdef _WIN64
typedef SQLRETURN  SQL_API _fn_SQLColAttributeType(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, __out_bcount_opt(BufferLength) SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLength, __out_opt SQLLEN *NumericAttribute);

typedef SQLRETURN SQL_API _fn_SQLColAttributeWType( SQLHSTMT        hstmt, SQLUSMALLINT    iCol, SQLUSMALLINT    iField, __out_bcount_opt(cbDescMax) SQLPOINTER      pCharAttr, SQLSMALLINT     cbDescMax, __out_opt SQLSMALLINT     *pcbCharAttr, __out_opt SQLLEN          *pNumAttr );

#else
typedef SQLRETURN  SQL_API _fn_SQLColAttributeType(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, __out_bcount_opt(BufferLength) SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLength, __out_opt SQLPOINTER NumericAttribute);

typedef SQLRETURN SQL_API _fn_SQLColAttributeWType( SQLHSTMT        hstmt, SQLUSMALLINT    iCol, SQLUSMALLINT    iField, __out_bcount_opt(cbDescMax) SQLPOINTER      pCharAttr, SQLSMALLINT     cbDescMax, __out_opt SQLSMALLINT     *pcbCharAttr, __out_opt SQLPOINTER      pNumAttr);

#endif
typedef SQLRETURN SQL_API _fn_SQLColumnPrivilegesType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLCHAR           *szTableName, SQLSMALLINT        cchTableName, __in_ecount_opt(cchColumnName) SQLCHAR           *szColumnName, SQLSMALLINT        cchColumnName);

typedef SQLRETURN SQL_API _fn_SQLColumnPrivilegesWType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, __in_ecount_opt(cchColumnName) SQLWCHAR*     szColumnName, SQLSMALLINT        cchColumnName );

typedef SQLRETURN  SQL_API _fn_SQLColumnsType(SQLHSTMT StatementHandle, __in_ecount_opt(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, __in_ecount_opt(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, __in_ecount_opt(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, __in_ecount_opt(NameLength4) SQLCHAR *ColumnName, SQLSMALLINT NameLength4);

typedef SQLRETURN SQL_API _fn_SQLColumnsWType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, __in_ecount_opt(cchColumnName) SQLWCHAR*     szColumnName, SQLSMALLINT        cchColumnName );

typedef SQLRETURN  SQL_API _fn_SQLConnectType(SQLHDBC ConnectionHandle, __in_ecount(NameLength1) SQLCHAR *ServerName, SQLSMALLINT NameLength1, __in_ecount(NameLength2) SQLCHAR *UserName, SQLSMALLINT NameLength2, __in_ecount(NameLength3) SQLCHAR *Authentication, SQLSMALLINT NameLength3);

typedef SQLRETURN SQL_API _fn_SQLConnectWType( SQLHDBC             hdbc, __in_ecount(cchDSN) SQLWCHAR* szDSN, SQLSMALLINT         cchDSN, __in_ecount(cchUID) SQLWCHAR* szUID, SQLSMALLINT         cchUID, __in_ecount(cchAuthStr) SQLWCHAR* szAuthStr, SQLSMALLINT         cchAuthStr );

typedef SQLRETURN  SQL_API _fn_SQLCopyDescType(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle);

typedef SQLRETURN  SQL_API _fn_SQLDescribeColType(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, __out_ecount_opt(BufferLength) SQLCHAR *ColumnName, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *NameLength, __out_opt SQLSMALLINT *DataType, __out_opt SQLULEN *ColumnSize, __out_opt SQLSMALLINT *DecimalDigits, __out_opt SQLSMALLINT *Nullable);

typedef SQLRETURN SQL_API _fn_SQLDescribeColWType( SQLHSTMT            hstmt, SQLUSMALLINT        icol, __out_ecount_opt(cchColNameMax) SQLWCHAR* szColName, SQLSMALLINT         cchColNameMax, __out_opt SQLSMALLINT*        pcchColName, __out_opt SQLSMALLINT*        pfSqlType, __out_opt SQLULEN*            pcbColDef, __out_opt SQLSMALLINT*        pibScale, __out_opt SQLSMALLINT*        pfNullable );

typedef SQLRETURN SQL_API _fn_SQLDescribeParamType( SQLHSTMT           hstmt, SQLUSMALLINT       ipar, __out_opt SQLSMALLINT       *pfSqlType, __out_opt SQLULEN           *pcbParamDef, __out_opt SQLSMALLINT       *pibScale, __out_opt SQLSMALLINT       *pfNullable);

typedef SQLRETURN  SQL_API _fn_SQLDisconnectType(SQLHDBC ConnectionHandle);

typedef SQLRETURN SQL_API _fn_SQLDriverConnectType( SQLHDBC            hdbc, SQLHWND            hwnd, __in_ecount(cchConnStrIn) SQLCHAR           *szConnStrIn, SQLSMALLINT        cchConnStrIn, __out_ecount_opt(cchConnStrOutMax) SQLCHAR           *szConnStrOut, SQLSMALLINT        cchConnStrOutMax, __out_opt SQLSMALLINT       *pcchConnStrOut, SQLUSMALLINT       fDriverCompletion);

typedef SQLRETURN SQL_API _fn_SQLDriverConnectWType( SQLHDBC             hdbc, SQLHWND             hwnd, __in_ecount(cchConnStrIn) SQLWCHAR* szConnStrIn, SQLSMALLINT         cchConnStrIn, __out_ecount_opt(cchConnStrOutMax) SQLWCHAR* szConnStrOut, SQLSMALLINT         cchConnStrOutMax, __out_opt SQLSMALLINT*        pcchConnStrOut, SQLUSMALLINT        fDriverCompletion );

typedef SQLRETURN  SQL_API _fn_SQLEndTranType(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType);

typedef SQLRETURN  SQL_API _fn_SQLExecDirectType( SQLHSTMT StatementHandle, __in_ecount_opt(TextLength) SQLCHAR* StatementText, SQLINTEGER TextLength );

typedef SQLRETURN SQL_API _fn_SQLExecDirectWType( SQLHSTMT    hstmt, __in_ecount_opt(TextLength) SQLWCHAR* szSqlStr, SQLINTEGER  TextLength );

typedef SQLRETURN  SQL_API _fn_SQLExecuteType(SQLHSTMT StatementHandle);

typedef SQLRETURN  SQL_API _fn_SQLFetchType(SQLHSTMT StatementHandle);

typedef SQLRETURN  SQL_API _fn_SQLFetchScrollType(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset);

typedef SQLRETURN SQL_API _fn_SQLForeignKeysType( SQLHSTMT           hstmt, __in_ecount_opt(cchPkCatalogName) SQLCHAR           *szPkCatalogName, SQLSMALLINT        cchPkCatalogName, __in_ecount_opt(cchPkSchemaName) SQLCHAR           *szPkSchemaName, SQLSMALLINT        cchPkSchemaName, __in_ecount_opt(cchPkTableName) SQLCHAR           *szPkTableName, SQLSMALLINT        cchPkTableName, __in_ecount_opt(cchFkCatalogName) SQLCHAR           *szFkCatalogName, SQLSMALLINT        cchFkCatalogName, __in_ecount_opt(cchFkSchemaName) SQLCHAR           *szFkSchemaName, SQLSMALLINT        cchFkSchemaName, __in_ecount_opt(cchFkTableName) SQLCHAR           *szFkTableName, SQLSMALLINT        cchFkTableName);

typedef SQLRETURN SQL_API _fn_SQLForeignKeysWType( SQLHSTMT           hstmt, __in_ecount_opt(cchPkCatalogName) SQLWCHAR*    szPkCatalogName, SQLSMALLINT        cchPkCatalogName, __in_ecount_opt(cchPkSchemaName) SQLWCHAR*     szPkSchemaName, SQLSMALLINT        cchPkSchemaName, __in_ecount_opt(cchPkTableName) SQLWCHAR*      szPkTableName, SQLSMALLINT        cchPkTableName, __in_ecount_opt(cchFkCatalogName) SQLWCHAR*    szFkCatalogName, SQLSMALLINT        cchFkCatalogName, __in_ecount_opt(cchFkSchemaName) SQLWCHAR*     szFkSchemaName, SQLSMALLINT        cchFkSchemaName, __in_ecount_opt(cchFkTableName) SQLWCHAR*      szFkTableName, SQLSMALLINT        cchFkTableName );

typedef SQLRETURN  SQL_API _fn_SQLFreeStmtType(SQLHSTMT StatementHandle, SQLUSMALLINT Option);

typedef SQLRETURN  SQL_API _fn_SQLFreeHandleType(SQLSMALLINT HandleType, SQLHANDLE Handle);

typedef SQLRETURN  SQL_API _fn_SQLGetConnectAttrType(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, __out_xcount_opt(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength, __out_opt SQLINTEGER *StringLengthPtr);

typedef SQLRETURN SQL_API _fn_SQLGetConnectAttrWType( SQLHDBC     hdbc, SQLINTEGER  fAttribute, __out_xcount_opt(cbValueMax) SQLPOINTER  rgbValue, SQLINTEGER  cbValueMax, __out_opt SQLINTEGER* pcbValue );

typedef SQLRETURN  SQL_API _fn_SQLGetCursorNameType( SQLHSTMT StatementHandle, __out_ecount_opt(BufferLength) SQLCHAR *CursorName, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *NameLengthPtr );

typedef SQLRETURN SQL_API _fn_SQLGetCursorNameWType( SQLHSTMT        hstmt, __out_ecount_opt(cchCursorMax) SQLWCHAR* szCursor, SQLSMALLINT     cchCursorMax, __out_opt SQLSMALLINT*    pcchCursor );

typedef SQLRETURN  SQL_API _fn_SQLGetDataType(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, __out_xcount_opt(BufferLength) SQLPOINTER TargetValue, SQLLEN BufferLength, __out_opt SQLLEN *StrLen_or_IndPtr);

typedef SQLRETURN  SQL_API _fn_SQLGetDescFieldType(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, __out_xcount_opt(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength, __out_opt SQLINTEGER *StringLength);

typedef SQLRETURN SQL_API _fn_SQLGetDescFieldWType( SQLHDESC        hdesc, SQLSMALLINT     iRecord, SQLSMALLINT     iField, __out_xcount_opt(cbBufferLength) SQLPOINTER      rgbValue, SQLINTEGER      cbBufferLength, __out_opt SQLINTEGER      *StringLength );

typedef SQLRETURN  SQL_API _fn_SQLGetDescRecType(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, __out_ecount_opt(BufferLength) SQLCHAR *Name, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLengthPtr, __out_opt SQLSMALLINT *TypePtr, __out_opt SQLSMALLINT *SubTypePtr, __out_opt SQLLEN     *LengthPtr, __out_opt SQLSMALLINT *PrecisionPtr, __out_opt SQLSMALLINT *ScalePtr, __out_opt SQLSMALLINT *NullablePtr);

typedef SQLRETURN SQL_API _fn_SQLGetDescRecWType( SQLHDESC        hdesc, SQLSMALLINT     iRecord, __out_ecount_opt(cchNameMax) SQLWCHAR* szName, SQLSMALLINT     cchNameMax, __out_opt SQLSMALLINT     *pcchName, __out_opt SQLSMALLINT     *pfType, __out_opt SQLSMALLINT     *pfSubType, __out_opt SQLLEN          *pLength, __out_opt SQLSMALLINT     *pPrecision, __out_opt SQLSMALLINT     *pScale, __out_opt SQLSMALLINT     *pNullable );

typedef SQLRETURN  SQL_API _fn_SQLGetDiagFieldType(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, __out_xcount_opt(BufferLength) SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLength);

typedef SQLRETURN SQL_API _fn_SQLGetDiagFieldWType( SQLSMALLINT     fHandleType, SQLHANDLE       handle, SQLSMALLINT     iRecord, SQLSMALLINT     fDiagField, __out_xcount_opt(cbBufferLength) SQLPOINTER      rgbDiagInfo, SQLSMALLINT     cbBufferLength, __out_opt SQLSMALLINT     *pcbStringLength );

typedef SQLRETURN  SQL_API _fn_SQLGetDiagRecType( SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, __out_ecount_opt(6) SQLCHAR *Sqlstate, SQLINTEGER *NativeError, __out_ecount_opt(BufferLength) SQLCHAR* MessageText, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *TextLength );

typedef SQLRETURN SQL_API _fn_SQLGetDiagRecWType( SQLSMALLINT     fHandleType, SQLHANDLE       handle, SQLSMALLINT     iRecord, __out_ecount_opt(6) SQLWCHAR* szSqlState, SQLINTEGER*     pfNativeError, __out_ecount_opt(cchErrorMsgMax) SQLWCHAR* szErrorMsg, SQLSMALLINT     cchErrorMsgMax, SQLSMALLINT*    pcchErrorMsg );

typedef SQLRETURN  SQL_API _fn_SQLGetEnvAttrType(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, __out_xcount(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength, __out_opt SQLINTEGER *StringLength);

typedef SQLRETURN  SQL_API _fn_SQLGetInfoType(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, __out_bcount_opt(BufferLength) SQLPOINTER InfoValue, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLengthPtr);

typedef SQLRETURN SQL_API _fn_SQLGetInfoWType( SQLHDBC                     hdbc, SQLUSMALLINT                fInfoType, __out_bcount_opt(cbInfoValueMax) SQLPOINTER rgbInfoValue, SQLSMALLINT        cbInfoValueMax, __out_opt SQLSMALLINT*                pcbInfoValue);

typedef SQLRETURN  SQL_API _fn_SQLGetStmtAttrType(SQLHSTMT StatementHandle, SQLINTEGER Attribute, __out_xcount_opt(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength, __out_opt SQLINTEGER *StringLength);

typedef SQLRETURN SQL_API _fn_SQLGetStmtAttrWType( SQLHSTMT           hstmt, SQLINTEGER         fAttribute, SQLPOINTER         rgbValue, SQLINTEGER         cbValueMax, SQLINTEGER     *pcbValue);

typedef SQLRETURN  SQL_API _fn_SQLGetTypeInfoType(SQLHSTMT StatementHandle, SQLSMALLINT DataType);

typedef SQLRETURN SQL_API _fn_SQLGetTypeInfoWType( SQLHSTMT            StatementHandle, SQLSMALLINT         DataType);

typedef SQLRETURN SQL_API _fn_SQLMoreResultsType( SQLHSTMT           hstmt);

typedef SQLRETURN SQL_API _fn_SQLNativeSqlType( SQLHDBC            hdbc, __in_ecount(cchSqlStrIn) SQLCHAR* szSqlStrIn, SQLINTEGER  cchSqlStrIn, __out_ecount_opt(cchSqlStrMax) SQLCHAR* szSqlStr, SQLINTEGER         cchSqlStrMax, SQLINTEGER        *pcbSqlStr );

typedef SQLRETURN SQL_API _fn_SQLNativeSqlWType( SQLHDBC                                     hdbc, __in_ecount(cchSqlStrIn) SQLWCHAR*          szSqlStrIn, SQLINTEGER                                  cchSqlStrIn, __out_ecount_opt(cchSqlStrMax) SQLWCHAR*    szSqlStr, SQLINTEGER                                  cchSqlStrMax, SQLINTEGER*                                 pcchSqlStr );

typedef SQLRETURN  SQL_API _fn_SQLNumResultColsType(SQLHSTMT StatementHandle, __out SQLSMALLINT *ColumnCount);

typedef SQLRETURN  SQL_API _fn_SQLParamDataType(SQLHSTMT StatementHandle, __out_opt SQLPOINTER *Value);

typedef SQLRETURN  SQL_API _fn_SQLPrepareType( SQLHSTMT StatementHandle, __in_ecount(TextLength) SQLCHAR* StatementText, SQLINTEGER TextLength );

typedef SQLRETURN SQL_API _fn_SQLPrepareWType( SQLHSTMT    hstmt, __in_ecount(cchSqlStr) SQLWCHAR* szSqlStr, SQLINTEGER  cchSqlStr );

typedef SQLRETURN SQL_API _fn_SQLPrimaryKeysType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLCHAR           *szTableName, SQLSMALLINT        cchTableName);

typedef SQLRETURN SQL_API _fn_SQLPrimaryKeysWType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName );

typedef SQLRETURN SQL_API _fn_SQLProcedureColumnsType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchProcName) SQLCHAR           *szProcName, SQLSMALLINT        cchProcName, __in_ecount_opt(cchColumnName) SQLCHAR           *szColumnName, SQLSMALLINT        cchColumnName);

typedef SQLRETURN SQL_API _fn_SQLProcedureColumnsWType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchProcName) SQLWCHAR*       szProcName, SQLSMALLINT        cchProcName, __in_ecount_opt(cchColumnName) SQLWCHAR*     szColumnName, SQLSMALLINT        cchColumnName );

typedef SQLRETURN SQL_API _fn_SQLProceduresType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchProcName) SQLCHAR           *szProcName, SQLSMALLINT        cchProcName);

typedef SQLRETURN SQL_API _fn_SQLProceduresWType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchProcName) SQLWCHAR*      szProcName, SQLSMALLINT        cchProcName );

typedef SQLRETURN  SQL_API _fn_SQLPutDataType(SQLHSTMT StatementHandle, __in_xcount(StrLen_or_Ind) SQLPOINTER Data, SQLLEN StrLen_or_Ind);

typedef SQLRETURN  SQL_API _fn_SQLRowCountType(__in SQLHSTMT StatementHandle, __out SQLLEN* RowCount);

typedef SQLRETURN  SQL_API _fn_SQLSetConnectAttrType(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, __in_bcount_opt(StringLength) SQLPOINTER Value, SQLINTEGER StringLength);

typedef SQLRETURN SQL_API _fn_SQLSetConnectAttrWType( SQLHDBC            hdbc, SQLINTEGER         fAttribute, __in_bcount_opt(cbValue) SQLPOINTER         rgbValue, SQLINTEGER         cbValue);

typedef SQLRETURN  SQL_API _fn_SQLSetCursorNameType( SQLHSTMT StatementHandle, __in_ecount(NameLength) SQLCHAR* CursorName, SQLSMALLINT NameLength );

typedef SQLRETURN SQL_API _fn_SQLSetCursorNameWType( SQLHSTMT            hstmt, __in_ecount(cchCursor) SQLWCHAR* szCursor, SQLSMALLINT         cchCursor );

typedef SQLRETURN  SQL_API _fn_SQLSetDescFieldType(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, __in_xcount(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength);

typedef SQLRETURN  SQL_API _fn_SQLSetDescFieldWType( SQLHDESC        DescriptorHandle, SQLSMALLINT     RecNumber, SQLSMALLINT     FieldIdentifier, SQLPOINTER      Value, SQLINTEGER      BufferLength );

typedef SQLRETURN  SQL_API _fn_SQLSetDescRecType(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT Type, SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale, __inout_bcount_opt(Length) SQLPOINTER Data, __inout_opt SQLLEN *StringLength, __inout_opt SQLLEN *Indicator);

typedef SQLRETURN  SQL_API _fn_SQLSetEnvAttrType(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, __in_bcount(StringLength) SQLPOINTER Value, SQLINTEGER StringLength);

typedef SQLRETURN SQL_API _fn_SQLSetPosType( SQLHSTMT           hstmt, SQLSETPOSIROW      irow, SQLUSMALLINT       fOption, SQLUSMALLINT       fLock);

typedef SQLRETURN SQL_API _fn_SQLSetScrollOptionsType( SQLHSTMT           hstmt, SQLUSMALLINT       fConcurrency, SQLLEN             crowKeyset, SQLUSMALLINT       crowRowset);

typedef SQLRETURN  SQL_API _fn_SQLSetStmtAttrType(SQLHSTMT StatementHandle, SQLINTEGER Attribute, __in_xcount(StringLength) SQLPOINTER Value, SQLINTEGER StringLength);

typedef SQLRETURN SQL_API _fn_SQLSetStmtAttrWType( SQLHSTMT           hstmt, SQLINTEGER         fAttribute, SQLPOINTER         rgbValue, SQLINTEGER         cbValueMax);

typedef SQLRETURN  SQL_API _fn_SQLSpecialColumnsType(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, __in_ecount_opt(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, __in_ecount_opt(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, __in_ecount_opt(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, SQLUSMALLINT Nullable);

typedef SQLRETURN SQL_API _fn_SQLSpecialColumnsWType( SQLHSTMT           hstmt, SQLUSMALLINT       fColType, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, SQLUSMALLINT       fScope, SQLUSMALLINT       fNullable );

typedef SQLRETURN  SQL_API _fn_SQLStatisticsType(SQLHSTMT StatementHandle, __in_ecount_opt(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, __in_ecount_opt(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, __in_ecount_opt(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved);

typedef SQLRETURN SQL_API _fn_SQLStatisticsWType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, SQLUSMALLINT       fUnique, SQLUSMALLINT       fAccuracy );

typedef SQLRETURN SQL_API _fn_SQLTablePrivilegesType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLCHAR           *szTableName, SQLSMALLINT        cchTableName);

typedef SQLRETURN SQL_API _fn_SQLTablePrivilegesWType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName );

typedef SQLRETURN  SQL_API _fn_SQLTablesType(SQLHSTMT StatementHandle, __in_ecount_opt(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, __in_ecount_opt(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, __in_ecount_opt(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, __in_ecount_opt(NameLength4) SQLCHAR *TableType, SQLSMALLINT NameLength4);;

typedef SQLRETURN SQL_API _fn_SQLTablesWType( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, __in_ecount_opt(cchTableType) SQLWCHAR*      szTableType, SQLSMALLINT        cchTableType );

typedef SQLRETURN  SQL_API _fn_SQLTransactType(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType);
// TYPEDEFs for function pointers END - generated code

class ODBCWrapper {
private:

    bool initDone;

    const char *libraryPath;

public:


    boost::mutex initMutex;

	static DynLib *odbcLib;

	// Static function variables - generated code
	static _fn_SQLAllocHandleType* _fn_SQLAllocHandle;
	static _fn_SQLBindColType* _fn_SQLBindCol;
	static _fn_SQLBindParameterType* _fn_SQLBindParameter;
	static _fn_SQLBrowseConnectType* _fn_SQLBrowseConnect;
	static _fn_SQLBrowseConnectWType* _fn_SQLBrowseConnectW;
	static _fn_SQLBulkOperationsType* _fn_SQLBulkOperations;
	static _fn_SQLCancelType* _fn_SQLCancel;
	static _fn_SQLCloseCursorType* _fn_SQLCloseCursor;
#ifdef _WIN64
	static _fn_SQLColAttributeType* _fn_SQLColAttribute;
	static _fn_SQLColAttributeWType* _fn_SQLColAttributeW;
#else
	static _fn_SQLColAttributeType* _fn_SQLColAttribute;
	static _fn_SQLColAttributeWType* _fn_SQLColAttributeW;
#endif
	static _fn_SQLColumnPrivilegesType* _fn_SQLColumnPrivileges;
	static _fn_SQLColumnPrivilegesWType* _fn_SQLColumnPrivilegesW;
	static _fn_SQLColumnsType* _fn_SQLColumns;
	static _fn_SQLColumnsWType* _fn_SQLColumnsW;
	static _fn_SQLConnectType* _fn_SQLConnect;
	static _fn_SQLConnectWType* _fn_SQLConnectW;
	static _fn_SQLCopyDescType* _fn_SQLCopyDesc;
	static _fn_SQLDescribeColType* _fn_SQLDescribeCol;
	static _fn_SQLDescribeColWType* _fn_SQLDescribeColW;
	static _fn_SQLDescribeParamType* _fn_SQLDescribeParam;
	static _fn_SQLDisconnectType* _fn_SQLDisconnect;
	static _fn_SQLDriverConnectType* _fn_SQLDriverConnect;
	static _fn_SQLDriverConnectWType* _fn_SQLDriverConnectW;
	static _fn_SQLEndTranType* _fn_SQLEndTran;
	static _fn_SQLExecDirectType* _fn_SQLExecDirect;
	static _fn_SQLExecDirectWType* _fn_SQLExecDirectW;
	static _fn_SQLExecuteType* _fn_SQLExecute;
	static _fn_SQLFetchType* _fn_SQLFetch;
	static _fn_SQLFetchScrollType* _fn_SQLFetchScroll;
	static _fn_SQLForeignKeysType* _fn_SQLForeignKeys;
	static _fn_SQLForeignKeysWType* _fn_SQLForeignKeysW;
	static _fn_SQLFreeStmtType* _fn_SQLFreeStmt;
	static _fn_SQLFreeHandleType* _fn_SQLFreeHandle;
	static _fn_SQLGetConnectAttrType* _fn_SQLGetConnectAttr;
	static _fn_SQLGetConnectAttrWType* _fn_SQLGetConnectAttrW;
	static _fn_SQLGetCursorNameType* _fn_SQLGetCursorName;
	static _fn_SQLGetCursorNameWType* _fn_SQLGetCursorNameW;
	static _fn_SQLGetDataType* _fn_SQLGetData;
	static _fn_SQLGetDescFieldType* _fn_SQLGetDescField;
	static _fn_SQLGetDescFieldWType* _fn_SQLGetDescFieldW;
	static _fn_SQLGetDescRecType* _fn_SQLGetDescRec;
	static _fn_SQLGetDescRecWType* _fn_SQLGetDescRecW;
	static _fn_SQLGetDiagFieldType* _fn_SQLGetDiagField;
	static _fn_SQLGetDiagFieldWType* _fn_SQLGetDiagFieldW;
	static _fn_SQLGetDiagRecType* _fn_SQLGetDiagRec;
	static _fn_SQLGetDiagRecWType* _fn_SQLGetDiagRecW;
	static _fn_SQLGetEnvAttrType* _fn_SQLGetEnvAttr;
	static _fn_SQLGetInfoType* _fn_SQLGetInfo;
	static _fn_SQLGetInfoWType* _fn_SQLGetInfoW;
	static _fn_SQLGetStmtAttrType* _fn_SQLGetStmtAttr;
	static _fn_SQLGetStmtAttrWType* _fn_SQLGetStmtAttrW;
	static _fn_SQLGetTypeInfoType* _fn_SQLGetTypeInfo;
	static _fn_SQLGetTypeInfoWType* _fn_SQLGetTypeInfoW;
	static _fn_SQLMoreResultsType* _fn_SQLMoreResults;
	static _fn_SQLNativeSqlType* _fn_SQLNativeSql;
	static _fn_SQLNativeSqlWType* _fn_SQLNativeSqlW;
	static _fn_SQLNumResultColsType* _fn_SQLNumResultCols;
	static _fn_SQLParamDataType* _fn_SQLParamData;
	static _fn_SQLPrepareType* _fn_SQLPrepare;
	static _fn_SQLPrepareWType* _fn_SQLPrepareW;
	static _fn_SQLPrimaryKeysType* _fn_SQLPrimaryKeys;
	static _fn_SQLPrimaryKeysWType* _fn_SQLPrimaryKeysW;
	static _fn_SQLProcedureColumnsType* _fn_SQLProcedureColumns;
	static _fn_SQLProcedureColumnsWType* _fn_SQLProcedureColumnsW;
	static _fn_SQLProceduresType* _fn_SQLProcedures;
	static _fn_SQLProceduresWType* _fn_SQLProceduresW;
	static _fn_SQLPutDataType* _fn_SQLPutData;
	static _fn_SQLRowCountType* _fn_SQLRowCount;
	static _fn_SQLSetConnectAttrType* _fn_SQLSetConnectAttr;
	static _fn_SQLSetConnectAttrWType* _fn_SQLSetConnectAttrW;
	static _fn_SQLSetCursorNameType* _fn_SQLSetCursorName;
	static _fn_SQLSetCursorNameWType* _fn_SQLSetCursorNameW;
	static _fn_SQLSetDescFieldType* _fn_SQLSetDescField;
	static _fn_SQLSetDescFieldWType* _fn_SQLSetDescFieldW;
	static _fn_SQLSetDescRecType* _fn_SQLSetDescRec;
	static _fn_SQLSetEnvAttrType* _fn_SQLSetEnvAttr;
	static _fn_SQLSetPosType* _fn_SQLSetPos;
	static _fn_SQLSetScrollOptionsType* _fn_SQLSetScrollOptions;
	static _fn_SQLSetStmtAttrType* _fn_SQLSetStmtAttr;
	static _fn_SQLSetStmtAttrWType* _fn_SQLSetStmtAttrW;
	static _fn_SQLSpecialColumnsType* _fn_SQLSpecialColumns;
	static _fn_SQLSpecialColumnsWType* _fn_SQLSpecialColumnsW;
	static _fn_SQLStatisticsType* _fn_SQLStatistics;
	static _fn_SQLStatisticsWType* _fn_SQLStatisticsW;
	static _fn_SQLTablePrivilegesType* _fn_SQLTablePrivileges;
	static _fn_SQLTablePrivilegesWType* _fn_SQLTablePrivilegesW;
	static _fn_SQLTablesType* _fn_SQLTables;
	static _fn_SQLTablesWType* _fn_SQLTablesW;
	static _fn_SQLTransactType* _fn_SQLTransact;
	// Static function variables END - generated code

	public:
	ODBCWrapper(const char *);
	virtual ~ODBCWrapper();

	bool init();

	void *resolve(const char *);

	// ODBC Function declarations - generated code
SQLRETURN  SQL_API SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, __out SQLHANDLE *OutputHandle);

SQLRETURN  SQL_API SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, __inout_xcount_opt(BufferLength) SQLPOINTER TargetValue, SQLLEN BufferLength, __inout_opt SQLLEN *StrLen_or_Ind);

SQLRETURN SQL_API SQLBindParameter( SQLHSTMT           hstmt, SQLUSMALLINT       ipar, SQLSMALLINT        fParamType, SQLSMALLINT        fCType, SQLSMALLINT        fSqlType, SQLULEN            cbColDef, SQLSMALLINT        ibScale, SQLPOINTER         rgbValue, SQLLEN             cbValueMax, SQLLEN             *pcbValue);

SQLRETURN SQL_API SQLBrowseConnect( SQLHDBC            hdbc, __in_ecount(cchConnStrIn) SQLCHAR           *szConnStrIn, SQLSMALLINT        cchConnStrIn, __out_ecount_opt(cchConnStrOutMax) SQLCHAR           *szConnStrOut, SQLSMALLINT        cchConnStrOutMax, __out_opt SQLSMALLINT       *pcchConnStrOut);

SQLRETURN SQL_API SQLBrowseConnectW ( SQLHDBC             hdbc, __in_ecount(cchConnStrIn) SQLWCHAR* szConnStrIn, SQLSMALLINT         cchConnStrIn, __out_ecount_opt(cchConnStrOutMax) SQLWCHAR* szConnStrOut, SQLSMALLINT         cchConnStrOutMax, __out_opt SQLSMALLINT*        pcchConnStrOut );

SQLRETURN   SQL_API SQLBulkOperations( SQLHSTMT            StatementHandle, SQLSMALLINT         Operation);

SQLRETURN  SQL_API SQLCancel(SQLHSTMT StatementHandle);

SQLRETURN  SQL_API SQLCloseCursor(SQLHSTMT StatementHandle);

#ifdef _WIN64
SQLRETURN  SQL_API SQLColAttribute (SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, __out_bcount_opt(BufferLength) SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLength, __out_opt SQLLEN *NumericAttribute);

SQLRETURN SQL_API SQLColAttributeW ( SQLHSTMT        hstmt, SQLUSMALLINT    iCol, SQLUSMALLINT    iField, __out_bcount_opt(cbDescMax) SQLPOINTER      pCharAttr, SQLSMALLINT     cbDescMax, __out_opt SQLSMALLINT     *pcbCharAttr, __out_opt SQLLEN          *pNumAttr );

#else
SQLRETURN  SQL_API SQLColAttribute (SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, __out_bcount_opt(BufferLength) SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLength, __out_opt SQLPOINTER NumericAttribute);

SQLRETURN SQL_API SQLColAttributeW( SQLHSTMT        hstmt, SQLUSMALLINT    iCol, SQLUSMALLINT    iField, __out_bcount_opt(cbDescMax) SQLPOINTER      pCharAttr, SQLSMALLINT     cbDescMax, __out_opt SQLSMALLINT     *pcbCharAttr, __out_opt SQLPOINTER      pNumAttr);

#endif
SQLRETURN SQL_API SQLColumnPrivileges( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLCHAR           *szTableName, SQLSMALLINT        cchTableName, __in_ecount_opt(cchColumnName) SQLCHAR           *szColumnName, SQLSMALLINT        cchColumnName);

SQLRETURN SQL_API SQLColumnPrivilegesW( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, __in_ecount_opt(cchColumnName) SQLWCHAR*     szColumnName, SQLSMALLINT        cchColumnName );

SQLRETURN  SQL_API SQLColumns(SQLHSTMT StatementHandle, __in_ecount_opt(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, __in_ecount_opt(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, __in_ecount_opt(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, __in_ecount_opt(NameLength4) SQLCHAR *ColumnName, SQLSMALLINT NameLength4);

SQLRETURN SQL_API SQLColumnsW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, __in_ecount_opt(cchColumnName) SQLWCHAR*     szColumnName, SQLSMALLINT        cchColumnName );

SQLRETURN  SQL_API SQLConnect(SQLHDBC ConnectionHandle, __in_ecount(NameLength1) SQLCHAR *ServerName, SQLSMALLINT NameLength1, __in_ecount(NameLength2) SQLCHAR *UserName, SQLSMALLINT NameLength2, __in_ecount(NameLength3) SQLCHAR *Authentication, SQLSMALLINT NameLength3);

SQLRETURN SQL_API SQLConnectW ( SQLHDBC             hdbc, __in_ecount(cchDSN) SQLWCHAR* szDSN, SQLSMALLINT         cchDSN, __in_ecount(cchUID) SQLWCHAR* szUID, SQLSMALLINT         cchUID, __in_ecount(cchAuthStr) SQLWCHAR* szAuthStr, SQLSMALLINT         cchAuthStr );

SQLRETURN  SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle);

SQLRETURN  SQL_API SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, __out_ecount_opt(BufferLength) SQLCHAR *ColumnName, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *NameLength, __out_opt SQLSMALLINT *DataType, __out_opt SQLULEN *ColumnSize, __out_opt SQLSMALLINT *DecimalDigits, __out_opt SQLSMALLINT *Nullable);

SQLRETURN SQL_API SQLDescribeColW ( SQLHSTMT            hstmt, SQLUSMALLINT        icol, __out_ecount_opt(cchColNameMax) SQLWCHAR* szColName, SQLSMALLINT         cchColNameMax, __out_opt SQLSMALLINT*        pcchColName, __out_opt SQLSMALLINT*        pfSqlType, __out_opt SQLULEN*            pcbColDef, __out_opt SQLSMALLINT*        pibScale, __out_opt SQLSMALLINT*        pfNullable );

SQLRETURN SQL_API SQLDescribeParam( SQLHSTMT           hstmt, SQLUSMALLINT       ipar, __out_opt SQLSMALLINT       *pfSqlType, __out_opt SQLULEN           *pcbParamDef, __out_opt SQLSMALLINT       *pibScale, __out_opt SQLSMALLINT       *pfNullable);

SQLRETURN  SQL_API SQLDisconnect(SQLHDBC ConnectionHandle);

SQLRETURN SQL_API SQLDriverConnect( SQLHDBC            hdbc, SQLHWND            hwnd, __in_ecount(cchConnStrIn) SQLCHAR           *szConnStrIn, SQLSMALLINT        cchConnStrIn, __out_ecount_opt(cchConnStrOutMax) SQLCHAR           *szConnStrOut, SQLSMALLINT        cchConnStrOutMax, __out_opt SQLSMALLINT       *pcchConnStrOut, SQLUSMALLINT       fDriverCompletion);

SQLRETURN SQL_API SQLDriverConnectW ( SQLHDBC             hdbc, SQLHWND             hwnd, __in_ecount(cchConnStrIn) SQLWCHAR* szConnStrIn, SQLSMALLINT         cchConnStrIn, __out_ecount_opt(cchConnStrOutMax) SQLWCHAR* szConnStrOut, SQLSMALLINT         cchConnStrOutMax, __out_opt SQLSMALLINT*        pcchConnStrOut, SQLUSMALLINT        fDriverCompletion );

SQLRETURN  SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType);

SQLRETURN  SQL_API SQLExecDirect ( SQLHSTMT StatementHandle, __in_ecount_opt(TextLength) SQLCHAR* StatementText, SQLINTEGER TextLength );

SQLRETURN SQL_API SQLExecDirectW ( SQLHSTMT    hstmt, __in_ecount_opt(TextLength) SQLWCHAR* szSqlStr, SQLINTEGER  TextLength );

SQLRETURN  SQL_API SQLExecute(SQLHSTMT StatementHandle);

SQLRETURN  SQL_API SQLFetch(SQLHSTMT StatementHandle);

SQLRETURN  SQL_API SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset);

SQLRETURN SQL_API SQLForeignKeys( SQLHSTMT           hstmt, __in_ecount_opt(cchPkCatalogName) SQLCHAR           *szPkCatalogName, SQLSMALLINT        cchPkCatalogName, __in_ecount_opt(cchPkSchemaName) SQLCHAR           *szPkSchemaName, SQLSMALLINT        cchPkSchemaName, __in_ecount_opt(cchPkTableName) SQLCHAR           *szPkTableName, SQLSMALLINT        cchPkTableName, __in_ecount_opt(cchFkCatalogName) SQLCHAR           *szFkCatalogName, SQLSMALLINT        cchFkCatalogName, __in_ecount_opt(cchFkSchemaName) SQLCHAR           *szFkSchemaName, SQLSMALLINT        cchFkSchemaName, __in_ecount_opt(cchFkTableName) SQLCHAR           *szFkTableName, SQLSMALLINT        cchFkTableName);

SQLRETURN SQL_API SQLForeignKeysW ( SQLHSTMT           hstmt, __in_ecount_opt(cchPkCatalogName) SQLWCHAR*    szPkCatalogName, SQLSMALLINT        cchPkCatalogName, __in_ecount_opt(cchPkSchemaName) SQLWCHAR*     szPkSchemaName, SQLSMALLINT        cchPkSchemaName, __in_ecount_opt(cchPkTableName) SQLWCHAR*      szPkTableName, SQLSMALLINT        cchPkTableName, __in_ecount_opt(cchFkCatalogName) SQLWCHAR*    szFkCatalogName, SQLSMALLINT        cchFkCatalogName, __in_ecount_opt(cchFkSchemaName) SQLWCHAR*     szFkSchemaName, SQLSMALLINT        cchFkSchemaName, __in_ecount_opt(cchFkTableName) SQLWCHAR*      szFkTableName, SQLSMALLINT        cchFkTableName );

SQLRETURN  SQL_API SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option);

SQLRETURN  SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle);

SQLRETURN  SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, __out_xcount_opt(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength, __out_opt SQLINTEGER *StringLengthPtr);

SQLRETURN SQL_API SQLGetConnectAttrW ( SQLHDBC     hdbc, SQLINTEGER  fAttribute, __out_xcount_opt(cbValueMax) SQLPOINTER  rgbValue, SQLINTEGER  cbValueMax, __out_opt SQLINTEGER* pcbValue );

SQLRETURN  SQL_API SQLGetCursorName ( SQLHSTMT StatementHandle, __out_ecount_opt(BufferLength) SQLCHAR *CursorName, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *NameLengthPtr );

SQLRETURN SQL_API SQLGetCursorNameW ( SQLHSTMT        hstmt, __out_ecount_opt(cchCursorMax) SQLWCHAR* szCursor, SQLSMALLINT     cchCursorMax, __out_opt SQLSMALLINT*    pcchCursor );

SQLRETURN  SQL_API SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, __out_xcount_opt(BufferLength) SQLPOINTER TargetValue, SQLLEN BufferLength, __out_opt SQLLEN *StrLen_or_IndPtr);

SQLRETURN  SQL_API SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, __out_xcount_opt(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength, __out_opt SQLINTEGER *StringLength);

SQLRETURN SQL_API SQLGetDescFieldW ( SQLHDESC        hdesc, SQLSMALLINT     iRecord, SQLSMALLINT     iField, __out_xcount_opt(cbBufferLength) SQLPOINTER      rgbValue, SQLINTEGER      cbBufferLength, __out_opt SQLINTEGER      *StringLength );

SQLRETURN  SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, __out_ecount_opt(BufferLength) SQLCHAR *Name, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLengthPtr, __out_opt SQLSMALLINT *TypePtr, __out_opt SQLSMALLINT *SubTypePtr, __out_opt SQLLEN     *LengthPtr, __out_opt SQLSMALLINT *PrecisionPtr, __out_opt SQLSMALLINT *ScalePtr, __out_opt SQLSMALLINT *NullablePtr);

SQLRETURN SQL_API SQLGetDescRecW ( SQLHDESC        hdesc, SQLSMALLINT     iRecord, __out_ecount_opt(cchNameMax) SQLWCHAR* szName, SQLSMALLINT     cchNameMax, __out_opt SQLSMALLINT     *pcchName, __out_opt SQLSMALLINT     *pfType, __out_opt SQLSMALLINT     *pfSubType, __out_opt SQLLEN          *pLength, __out_opt SQLSMALLINT     *pPrecision, __out_opt SQLSMALLINT     *pScale, __out_opt SQLSMALLINT     *pNullable );

SQLRETURN  SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, __out_xcount_opt(BufferLength) SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLength);

SQLRETURN SQL_API SQLGetDiagFieldW ( SQLSMALLINT     fHandleType, SQLHANDLE       handle, SQLSMALLINT     iRecord, SQLSMALLINT     fDiagField, __out_xcount_opt(cbBufferLength) SQLPOINTER      rgbDiagInfo, SQLSMALLINT     cbBufferLength, __out_opt SQLSMALLINT     *pcbStringLength );

SQLRETURN  SQL_API SQLGetDiagRec ( SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, __out_ecount_opt(6) SQLCHAR *Sqlstate, SQLINTEGER *NativeError, __out_ecount_opt(BufferLength) SQLCHAR* MessageText, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *TextLength );

SQLRETURN SQL_API SQLGetDiagRecW ( SQLSMALLINT     fHandleType, SQLHANDLE       handle, SQLSMALLINT     iRecord, __out_ecount_opt(6) SQLWCHAR* szSqlState, SQLINTEGER*     pfNativeError, __out_ecount_opt(cchErrorMsgMax) SQLWCHAR* szErrorMsg, SQLSMALLINT     cchErrorMsgMax, SQLSMALLINT*    pcchErrorMsg );

SQLRETURN  SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, __out_xcount(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength, __out_opt SQLINTEGER *StringLength);

SQLRETURN  SQL_API SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, __out_bcount_opt(BufferLength) SQLPOINTER InfoValue, SQLSMALLINT BufferLength, __out_opt SQLSMALLINT *StringLengthPtr);

SQLRETURN SQL_API SQLGetInfoW( SQLHDBC                     hdbc, SQLUSMALLINT                fInfoType, __out_bcount_opt(cbInfoValueMax) SQLPOINTER rgbInfoValue, SQLSMALLINT        cbInfoValueMax, __out_opt SQLSMALLINT*                pcbInfoValue);

SQLRETURN  SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, __out_xcount_opt(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength, __out_opt SQLINTEGER *StringLength);

SQLRETURN SQL_API SQLGetStmtAttrW( SQLHSTMT           hstmt, SQLINTEGER         fAttribute, SQLPOINTER         rgbValue, SQLINTEGER         cbValueMax, SQLINTEGER     *pcbValue);

SQLRETURN  SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType);

SQLRETURN SQL_API SQLGetTypeInfoW( SQLHSTMT            StatementHandle, SQLSMALLINT         DataType);

SQLRETURN SQL_API SQLMoreResults( SQLHSTMT           hstmt);

SQLRETURN SQL_API SQLNativeSql ( SQLHDBC            hdbc, __in_ecount(cchSqlStrIn) SQLCHAR* szSqlStrIn, SQLINTEGER  cchSqlStrIn, __out_ecount_opt(cchSqlStrMax) SQLCHAR* szSqlStr, SQLINTEGER         cchSqlStrMax, SQLINTEGER        *pcbSqlStr );

SQLRETURN SQL_API SQLNativeSqlW ( SQLHDBC                                     hdbc, __in_ecount(cchSqlStrIn) SQLWCHAR*          szSqlStrIn, SQLINTEGER                                  cchSqlStrIn, __out_ecount_opt(cchSqlStrMax) SQLWCHAR*    szSqlStr, SQLINTEGER                                  cchSqlStrMax, SQLINTEGER*                                 pcchSqlStr );

SQLRETURN  SQL_API SQLNumResultCols(SQLHSTMT StatementHandle, __out SQLSMALLINT *ColumnCount);

SQLRETURN  SQL_API SQLParamData(SQLHSTMT StatementHandle, __out_opt SQLPOINTER *Value);

SQLRETURN  SQL_API SQLPrepare ( SQLHSTMT StatementHandle, __in_ecount(TextLength) SQLCHAR* StatementText, SQLINTEGER TextLength );

SQLRETURN SQL_API SQLPrepareW ( SQLHSTMT    hstmt, __in_ecount(cchSqlStr) SQLWCHAR* szSqlStr, SQLINTEGER  cchSqlStr );

SQLRETURN SQL_API SQLPrimaryKeys( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLCHAR           *szTableName, SQLSMALLINT        cchTableName);

SQLRETURN SQL_API SQLPrimaryKeysW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName );

SQLRETURN SQL_API SQLProcedureColumns( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchProcName) SQLCHAR           *szProcName, SQLSMALLINT        cchProcName, __in_ecount_opt(cchColumnName) SQLCHAR           *szColumnName, SQLSMALLINT        cchColumnName);

SQLRETURN SQL_API SQLProcedureColumnsW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchProcName) SQLWCHAR*       szProcName, SQLSMALLINT        cchProcName, __in_ecount_opt(cchColumnName) SQLWCHAR*     szColumnName, SQLSMALLINT        cchColumnName );

SQLRETURN SQL_API SQLProcedures( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchProcName) SQLCHAR           *szProcName, SQLSMALLINT        cchProcName);

SQLRETURN SQL_API SQLProceduresW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchProcName) SQLWCHAR*      szProcName, SQLSMALLINT        cchProcName );

SQLRETURN  SQL_API SQLPutData(SQLHSTMT StatementHandle, __in_xcount(StrLen_or_Ind) SQLPOINTER Data, SQLLEN StrLen_or_Ind);

SQLRETURN  SQL_API SQLRowCount(__in SQLHSTMT StatementHandle, __out SQLLEN* RowCount);

SQLRETURN  SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, __in_bcount_opt(StringLength) SQLPOINTER Value, SQLINTEGER StringLength);

SQLRETURN SQL_API SQLSetConnectAttrW( SQLHDBC            hdbc, SQLINTEGER         fAttribute, __in_bcount_opt(cbValue) SQLPOINTER         rgbValue, SQLINTEGER         cbValue);

SQLRETURN  SQL_API SQLSetCursorName ( SQLHSTMT StatementHandle, __in_ecount(NameLength) SQLCHAR* CursorName, SQLSMALLINT NameLength );

SQLRETURN SQL_API SQLSetCursorNameW ( SQLHSTMT            hstmt, __in_ecount(cchCursor) SQLWCHAR* szCursor, SQLSMALLINT         cchCursor );

SQLRETURN  SQL_API SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, __in_xcount(BufferLength) SQLPOINTER Value, SQLINTEGER BufferLength);

SQLRETURN  SQL_API SQLSetDescFieldW ( SQLHDESC        DescriptorHandle, SQLSMALLINT     RecNumber, SQLSMALLINT     FieldIdentifier, SQLPOINTER      Value, SQLINTEGER      BufferLength );

SQLRETURN  SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT Type, SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale, __inout_bcount_opt(Length) SQLPOINTER Data, __inout_opt SQLLEN *StringLength, __inout_opt SQLLEN *Indicator);

SQLRETURN  SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, __in_bcount(StringLength) SQLPOINTER Value, SQLINTEGER StringLength);

SQLRETURN SQL_API SQLSetPos( SQLHSTMT           hstmt, SQLSETPOSIROW      irow, SQLUSMALLINT       fOption, SQLUSMALLINT       fLock);

SQLRETURN SQL_API SQLSetScrollOptions( SQLHSTMT           hstmt, SQLUSMALLINT       fConcurrency, SQLLEN             crowKeyset, SQLUSMALLINT       crowRowset);

SQLRETURN  SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, __in_xcount(StringLength) SQLPOINTER Value, SQLINTEGER StringLength);

SQLRETURN SQL_API SQLSetStmtAttrW( SQLHSTMT           hstmt, SQLINTEGER         fAttribute, SQLPOINTER         rgbValue, SQLINTEGER         cbValueMax);

SQLRETURN  SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, __in_ecount_opt(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, __in_ecount_opt(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, __in_ecount_opt(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, SQLUSMALLINT Nullable);

SQLRETURN SQL_API SQLSpecialColumnsW ( SQLHSTMT           hstmt, SQLUSMALLINT       fColType, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, SQLUSMALLINT       fScope, SQLUSMALLINT       fNullable );

SQLRETURN  SQL_API SQLStatistics(SQLHSTMT StatementHandle, __in_ecount_opt(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, __in_ecount_opt(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, __in_ecount_opt(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved);

SQLRETURN SQL_API SQLStatisticsW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, SQLUSMALLINT       fUnique, SQLUSMALLINT       fAccuracy );

SQLRETURN SQL_API SQLTablePrivileges( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLCHAR           *szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLCHAR           *szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLCHAR           *szTableName, SQLSMALLINT        cchTableName);

SQLRETURN SQL_API SQLTablePrivilegesW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName );

SQLRETURN  SQL_API SQLTables(SQLHSTMT StatementHandle, __in_ecount_opt(NameLength1) SQLCHAR *CatalogName, SQLSMALLINT NameLength1, __in_ecount_opt(NameLength2) SQLCHAR *SchemaName, SQLSMALLINT NameLength2, __in_ecount_opt(NameLength3) SQLCHAR *TableName, SQLSMALLINT NameLength3, __in_ecount_opt(NameLength4) SQLCHAR *TableType, SQLSMALLINT NameLength4);;

SQLRETURN SQL_API SQLTablesW ( SQLHSTMT           hstmt, __in_ecount_opt(cchCatalogName) SQLWCHAR*    szCatalogName, SQLSMALLINT        cchCatalogName, __in_ecount_opt(cchSchemaName) SQLWCHAR*     szSchemaName, SQLSMALLINT        cchSchemaName, __in_ecount_opt(cchTableName) SQLWCHAR*      szTableName, SQLSMALLINT        cchTableName, __in_ecount_opt(cchTableType) SQLWCHAR*      szTableType, SQLSMALLINT        cchTableType );

SQLRETURN  SQL_API SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType);

	// ODBC Function declarations END - generated code


}; /* end of class ODBCWrapper */


#endif // ODBCWRAPPER_H_
